#ifndef _ZPicking_H_
#define _ZPicking_H_

struct RAY
{
	FLOAT		fT;
	D3DXVECTOR3 vPickRayDir;
	D3DXVECTOR3 vPickRayOrig;
};

class ZPicking
{
public:
	ZPicking(VOID);
	~ZPicking(VOID);

	VOID Update();
	RAY Get_Ray();
	D3DXVECTOR3 Get_PickPos()
	{
		return m_PickPos;
	}
	VOID Set_PickPos( D3DXVECTOR3 a_Value )
	{
		m_PickPos = a_Value;
	}
	VOID Set_PickPosY( FLOAT a_fValue )
	{
		m_PickPos.y = a_fValue;
	}

	BOOL CheckTriangleCollision( D3DXVECTOR3 &a_V0, D3DXVECTOR3 &a_V1, D3DXVECTOR3 &a_V2 );

private:
	D3DXMATRIXA16 m_matProj, m_matView, m_matViewInverse;
	D3DXVECTOR3 m_p;
	D3DXVECTOR3 m_v;
	D3DVIEWPORT9 m_vp;
	POINT m_ptCursor;
	RAY m_Ray;

	D3DXVECTOR3 m_PickPos;
};

#endif